﻿namespace Blaze.Framework.Versions
{
    using System.IO;

    /// <summary>
    /// 清单文件信息。
    /// </summary>
    public class ManifestInfo
    {
        public ObjectInfo[] Objects;

        public void Load(BinaryReader reader)
        {
            var fileCount = reader.ReadUInt32();
            Objects = new ObjectInfo[fileCount];
            for (var i = 0; i < fileCount; i++)
            {
                var obj = new ObjectInfo();
                obj.Load(reader);
                Objects[i] = obj;
            }
        }

        public void Write(BinaryWriter writer)
        {
            writer.Write((uint) Objects.Length);
            for (var i = 0; i < Objects.Length; i++)
            {
                var obj = Objects[i];
                obj.Write(writer);
            }
        }
    }
}